@(title: String, cssFile : String = null, calendarInfo : views.utils.CalendarInfo)(content: Html)

@import models.NewsDescriptor
@import models.NewsUtils
@import models.NewsBlock
@import views.utils.NewsHrefUtils

<!DOCTYPE html>

<html>
    <head>
        <title>@title</title>
        <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.18.1/build/cssreset-context/cssreset-context-min.css">
        <link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
        @if(cssFile != null){
        	<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/" + cssFile)">
        }
        <link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")">
        <script src="@routes.Assets.at("javascripts/script.js")" type="text/javascript"></script>
    </head>
    <body>
        <div id="main_container" class="center">
        	<div id="header_container" class="center">
        		<div id="title">
        			Клуб фигурного катания
        		</div>
        		<div id="club_name">
        			Б и л ь м а н
        		</div>
        	</div>
        	<table id="middle_container" class="center">
        		<tr>
        		<td id="middle_left">
        			<div id="adv1" class="center">
        			</div>
        			<div id="menu">
        				<div id="menu_item_container01" class="menu_item_container">
        					<a href="/" class="menu_item">Главная</a>
        				</div>
        				<div id="menu_item_container02" class="menu_item_container">
        					<a href="/news" class="menu_item">Новости</a>
        				</div>
        				<div id="menu_item_container03" class="menu_item_container">
        				    <a href="#" class="menu_item" onClick="javascript:movemenu('menu_item_container03');">
        				    	Расписание
        				    </a>
        				</div>
        				<div id="sub_menu_item_container03_01" class="sub_menu_item_container">
        				    <a href="/schedule" class="sub_menu_item">
        				    	Взрослые
        				    </a>
        				</div>
        				<div id="sub_menu_item_container03_02" class="sub_menu_item_container">
        				    <a href="/schedule_children" class="sub_menu_item">
        				    	Дети
        				    </a>
        				</div>
        				<div id="menu_item_container04" class="menu_item_container">
        					<a href="/photos" class="menu_item">Фотогалерея</a>
        				</div>
        				<div id="menu_item_container05" class="menu_item_container">
        					<a href="/videos" class="menu_item">Видео</a>
        				</div>
        				<div id="menu_item_container06" class="menu_item_container">
        					<a href="/contacts" class="menu_item">Контакты</a>
        				</div>
        				<div id="menu_item_container07" class="menu_item_container">
        					<a href="/forum" class="menu_item">Форум</a>
        				</div>
        			</div>
        			<div id="skater_man" class="center">
        			</div>
        		</td>
        		<td id="middle_center">
        			<div id="content_container">
        				@content
        			</div>
        		</td>
        		<td id="middle_right">
        			<div id="calendar" class="center">
        				<table>
        				@import controllers.utils.CalendarUtils
        				@import controllers.utils.CalendarDay
        					<th colspan="7">
        					   <a id="calendar_button_backward" href=@calendarInfo.getRefBackward>
        					   </a> &nbsp;
        						@{
        							val calendar = new CalendarUtils(calendarInfo.getMonthOffset)
        							calendar.getMonth + " " + calendar.getYear
        					     }
        					     &nbsp;
        					    <a id="calendar_button_forward" href=@calendarInfo.getRefForward>
        					    </a> 
        					</th>
        					<tr>
        						<td class="weekday">
        						Пн
        						</td>
        						<td class="weekday">
        						Вт
        						</td>
        						<td class="weekday">
        						Ср
        						</td>
        						<td class="weekday">
        						Чт
        						</td>
        						<td class="weekday">
        						Пт
        						</td>
        						<td class="weekend_day">
        						Сб
        						</td>
        						<td class="weekend_day">
        						Вс
        						</td>
        					</tr>
        					@for(i <-0 to 5){
        						<tr>
        							@for(j<-0 to 6){
        								<td class= @{
        									if(j > 4)
        										"weekend_day" 
        									else 
        										"weekday"
        									}
        								>
        									
        									@{ 
        									   val tmp = new CalendarUtils(calendarInfo.getMonthOffset).getDays(i, j) 
        									   if(tmp.isTodaysDay){ // indicates current day (today)
        									   	 <span id="current_calendar_day">
        									   	 	{tmp.getDay}
        									   	 </span>
        									   }else {
        									    if(tmp.isDayOfCurrentMonth){
        									     tmp.getDay
        									    }else {
        									    	<span class="day_of_other_month">
        									    		{tmp.getDay}
        									    	</span>
        									    }
        									   }
        									}
        								</td>
        							}
        						</tr>
        					}
        				</table>
        			</div>
        			<div id="default_news" class="center">
   		     			<div id="default_news_header">
   		     				<span>Новости</span>
        				</div>
        				<div id="default_news_content">
        					@for(news <- NewsUtils.nthNews(1)){
     							<h5>@news.getDate</h5>
     							@news.getBody
     						}
     					</div>
     					<div id="default_news_footer">
   		     				
        				</div>
        			</div>
        			<div id="skater_woman" class="center">
        			</div>
        		</td>
        		</tr>
        	</table>
        	<div id="footer_container" class="center">
        		<div id="copyright" class="center">
        			© All rights reserved 2015 
        		</div>
        	</div>
        </div>
    </body>
</html>
